!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.Reflux=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
    'use strict';

    /**
     * Representation of a single EventEmitter function.
     *
     * @param {Function} fn Event handler to be called.
     * @param {Mixed} context Context for function execution.
     * @param {Boolean} once Only emit once
     * @api private
     */
    function EE(fn, context, once) {
        this.fn = fn;
        this.context = context;
        this.once = once || false;
    }

    /**
     * Minimal EventEmitter interface that is molded against the Node.js
     * EventEmitter interface.
     *
     * @constructor
     * @api public
     */
    function EventEmitter() { /* Nothing to set */ }

    /**
     * Holds the assigned EventEmitters by name.
     *
     * @type {Object}
     * @private
     */
    EventEmitter.prototype._events = undefined;

    /**
     * Return a list of assigned event listeners.
     *
     * @param {String} event The events that should be listed.
     * @returns {Array}
     * @api public
     */
    EventEmitter.prototype.listeners = function listeners(event) {
        if (!this._events || !this._events[event]) return [];

        for (var i = 0, l = this._events[event].length, ee = []; i < l; i++) {
            ee.push(this._events[event][i].fn);
        }

        return ee;
    };

    /**
     * Emit an event to all registered event listeners.
     *
     * @param {String} event The name of the event.
     * @returns {Boolean} Indication if we've emitted an event.
     * @api public
     */
    EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
        if (!this._events || !this._events[event]) return false;

        var listeners = this._events[event]
            , length = listeners.length
            , len = arguments.length
            , ee = listeners[0]
            , args
            , i, j;

        if (1 === length) {
            if (ee.once) this.removeListener(event, ee.fn, true);

            switch (len) {
                case 1: return ee.fn.call(ee.context), true;
                case 2: return ee.fn.call(ee.context, a1), true;
                case 3: return ee.fn.call(ee.context, a1, a2), true;
                case 4: return ee.fn.call(ee.context, a1, a2, a3), true;
                case 5: return ee.fn.call(ee.context, a1, a2, a3, a4), true;
                case 6: return ee.fn.call(ee.context, a1, a2, a3, a4, a5), true;
            }

            for (i = 1, args = new Array(len -1); i < len; i++) {
                args[i - 1] = arguments[i];
            }

            ee.fn.apply(ee.context, args);
        } else {
            for (i = 0; i < length; i++) {
                if (listeners[i].once) this.removeListener(event, listeners[i].fn, true);

                switch (len) {
                    case 1: listeners[i].fn.call(listeners[i].context); break;
                    case 2: listeners[i].fn.call(listeners[i].context, a1); break;
                    case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;
                    default:
                        if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {
                            args[j - 1] = arguments[j];
                        }

                        listeners[i].fn.apply(listeners[i].context, args);
                }
            }
        }

        return true;
    };

    /**
     * Register a new EventListener for the given event.
     *
     * @param {String} event Name of the event.
     * @param {Functon} fn Callback function.
     * @param {Mixed} context The context of the function.
     * @api public
     */
    EventEmitter.prototype.on = function on(event, fn, context) {
        if (!this._events) this._events = {};
        if (!this._events[event]) this._events[event] = [];
        this._events[event].push(new EE( fn, context || this ));

        return this;
    };

    /**
     * Add an EventListener that's only called once.
     *
     * @param {String} event Name of the event.
     * @param {Function} fn Callback function.
     * @param {Mixed} context The context of the function.
     * @api public
     */
    EventEmitter.prototype.once = function once(event, fn, context) {
        if (!this._events) this._events = {};
        if (!this._events[event]) this._events[event] = [];
        this._events[event].push(new EE(fn, context || this, true ));

        return this;
    };

    /**
     * Remove event listeners.
     *
     * @param {String} event The event we want to remove.
     * @param {Function} fn The listener that we need to find.
     * @param {Boolean} once Only remove once listeners.
     * @api public
     */
    EventEmitter.prototype.removeListener = function removeListener(event, fn, once) {
        if (!this._events || !this._events[event]) return this;

        var listeners = this._events[event]
            , events = [];

        if (fn) for (var i = 0, length = listeners.length; i < length; i++) {
            if (listeners[i].fn !== fn && listeners[i].once !== once) {
                events.push(listeners[i]);
            }
        }

        //
        // Reset the array, or remove it completely if we have no more listeners.
        //
        if (events.length) this._events[event] = events;
        else this._events[event] = null;

        return this;
    };

    /**
     * Remove all listeners or only the listeners for the specified event.
     *
     * @param {String} event The event want to remove all listeners for.
     * @api public
     */
    EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
        if (!this._events) return this;

        if (event) this._events[event] = null;
        else this._events = {};

        return this;
    };

//
// Alias methods names because people roll like that.
//
    EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
    EventEmitter.prototype.addListener = EventEmitter.prototype.on;

//
// This function doesn't apply anymore.
//
    EventEmitter.prototype.setMaxListeners = function setMaxListeners() {
        return this;
    };

//
// Expose the module.
//
    EventEmitter.EventEmitter = EventEmitter;
    EventEmitter.EventEmitter2 = EventEmitter;
    EventEmitter.EventEmitter3 = EventEmitter;

    if ('object' === typeof module && module.exports) {
        module.exports = EventEmitter;
    }

},{}],2:[function(_dereq_,module,exports){
    (function (global){
        /*! Native Promise Only
         v0.7.6-a (c) Kyle Simpson
         MIT License: http://getify.mit-license.org
         */
        !function(t,n,e){n[t]=n[t]||e(),"undefined"!=typeof module&&module.exports?module.exports=n[t]:"function"==typeof define&&define.amd&&define(function(){return n[t]})}("Promise","undefined"!=typeof global?global:this,function(){"use strict";function t(t,n){l.add(t,n),h||(h=y(l.drain))}function n(t){var n,e=typeof t;return null==t||"object"!=e&&"function"!=e||(n=t.then),"function"==typeof n?n:!1}function e(){for(var t=0;t<this.chain.length;t++)o(this,1===this.state?this.chain[t].success:this.chain[t].failure,this.chain[t]);this.chain.length=0}function o(t,e,o){var r,i;try{e===!1?o.reject(t.msg):(r=e===!0?t.msg:e.call(void 0,t.msg),r===o.promise?o.reject(TypeError("Promise-chain cycle")):(i=n(r))?i.call(r,o.resolve,o.reject):o.resolve(r))}catch(c){o.reject(c)}}function r(o){var c,u,a=this;if(!a.triggered){a.triggered=!0,a.def&&(a=a.def);try{(c=n(o))?(u=new f(a),c.call(o,function(){r.apply(u,arguments)},function(){i.apply(u,arguments)})):(a.msg=o,a.state=1,a.chain.length>0&&t(e,a))}catch(s){i.call(u||new f(a),s)}}}function i(n){var o=this;o.triggered||(o.triggered=!0,o.def&&(o=o.def),o.msg=n,o.state=2,o.chain.length>0&&t(e,o))}function c(t,n,e,o){for(var r=0;r<n.length;r++)!function(r){t.resolve(n[r]).then(function(t){e(r,t)},o)}(r)}function f(t){this.def=t,this.triggered=!1}function u(t){this.promise=t,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function a(n){if("function"!=typeof n)throw TypeError("Not a function");if(0!==this.__NPO__)throw TypeError("Not a promise");this.__NPO__=1;var o=new u(this);this.then=function(n,r){var i={success:"function"==typeof n?n:!0,failure:"function"==typeof r?r:!1};return i.promise=new this.constructor(function(t,n){if("function"!=typeof t||"function"!=typeof n)throw TypeError("Not a function");i.resolve=t,i.reject=n}),o.chain.push(i),0!==o.state&&t(e,o),i.promise},this["catch"]=function(t){return this.then(void 0,t)};try{n.call(void 0,function(t){r.call(o,t)},function(t){i.call(o,t)})}catch(c){i.call(o,c)}}var s,h,l,p=Object.prototype.toString,y="undefined"!=typeof setImmediate?function(t){return setImmediate(t)}:setTimeout;try{Object.defineProperty({},"x",{}),s=function(t,n,e,o){return Object.defineProperty(t,n,{value:e,writable:!0,configurable:o!==!1})}}catch(d){s=function(t,n,e){return t[n]=e,t}}l=function(){function t(t,n){this.fn=t,this.self=n,this.next=void 0}var n,e,o;return{add:function(r,i){o=new t(r,i),e?e.next=o:n=o,e=o,o=void 0},drain:function(){var t=n;for(n=e=h=void 0;t;)t.fn.call(t.self),t=t.next}}}();var g=s({},"constructor",a,!1);return s(a,"prototype",g,!1),s(g,"__NPO__",0,!1),s(a,"resolve",function(t){var n=this;return t&&"object"==typeof t&&1===t.__NPO__?t:new n(function(n,e){if("function"!=typeof n||"function"!=typeof e)throw TypeError("Not a function");n(t)})}),s(a,"reject",function(t){return new this(function(n,e){if("function"!=typeof n||"function"!=typeof e)throw TypeError("Not a function");e(t)})}),s(a,"all",function(t){var n=this;return"[object Array]"!=p.call(t)?n.reject(TypeError("Not an array")):0===t.length?n.resolve([]):new n(function(e,o){if("function"!=typeof e||"function"!=typeof o)throw TypeError("Not a function");var r=t.length,i=Array(r),f=0;c(n,t,function(t,n){i[t]=n,++f===r&&e(i)},o)})}),s(a,"race",function(t){var n=this;return"[object Array]"!=p.call(t)?n.reject(TypeError("Not an array")):new n(function(e,o){if("function"!=typeof e||"function"!=typeof o)throw TypeError("Not a function");c(n,t,function(t,n){e(n)},o)})}),a});

    }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}],3:[function(_dereq_,module,exports){
    /**
     * A module of methods that you want to include in all actions.
     * This module is consumed by `createAction`.
     */
    module.exports = {
    };

},{}],4:[function(_dereq_,module,exports){
    exports.createdStores = [];

    exports.createdActions = [];

    exports.reset = function() {
        while(exports.createdStores.length) {
            exports.createdStores.pop();
        }
        while(exports.createdActions.length) {
            exports.createdActions.pop();
        }
    };

},{}],5:[function(_dereq_,module,exports){
    var _ = _dereq_('./utils'),
        maker = _dereq_('./joins').instanceJoinCreator;

    /**
     * Extract child listenables from a parent from their
     * children property and return them in a keyed Object
     *
     * @param {Object} listenable The parent listenable
     */
    var mapChildListenables = function(listenable) {
        var i = 0, children = {}, childName;
        for (;i < (listenable.children||[]).length; ++i) {
            childName = listenable.children[i];
            if(listenable[childName]){
                children[childName] = listenable[childName];
            }
        }
        return children;
    };

    /**
     * Make a flat dictionary of all listenables including their
     * possible children (recursively), concatenating names in camelCase.
     *
     * @param {Object} listenables The top-level listenables
     */
    var flattenListenables = function(listenables) {
        var flattened = {};
        for(var key in listenables){
            var listenable = listenables[key];
            var childMap = mapChildListenables(listenable);

            // recursively flatten children
            var children = flattenListenables(childMap);

            // add the primary listenable and chilren
            flattened[key] = listenable;
            for(var childKey in children){
                var childListenable = children[childKey];
                flattened[key + _.capitalize(childKey)] = childListenable;
            }
        }

        return flattened;
    };

    /**
     * A module of methods related to listening.
     */
    module.exports = {

        /**
         * An internal utility function used by `validateListening`
         *
         * @param {Action|Store} listenable The listenable we want to search for
         * @returns {Boolean} The result of a recursive search among `this.subscriptions`
         */
        hasListener: function(listenable) {
            var i = 0, j, listener, listenables;
            for (;i < (this.subscriptions||[]).length; ++i) {
                listenables = [].concat(this.subscriptions[i].listenable);
                for (j = 0; j < listenables.length; j++){
                    listener = listenables[j];
                    if (listener === listenable || listener.hasListener && listener.hasListener(listenable)) {
                        return true;
                    }
                }
            }
            return false;
        },

        /**
         * A convenience method that listens to all listenables in the given object.
         *
         * @param {Object} listenables An object of listenables. Keys will be used as callback method names.
         */
        listenToMany: function(listenables){
            var allListenables = flattenListenables(listenables);
            for(var key in allListenables){
                var cbname = _.callbackName(key),
                    localname = this[cbname] ? cbname : this[key] ? key : undefined;
                if (localname){
                    this.listenTo(allListenables[key],localname,this[cbname+"Default"]||this[localname+"Default"]||localname);
                }
            }
        },

        /**
         * Checks if the current context can listen to the supplied listenable
         *
         * @param {Action|Store} listenable An Action or Store that should be
         *  listened to.
         * @returns {String|Undefined} An error message, or undefined if there was no problem.
         */
        validateListening: function(listenable){
            if (listenable === this) {
                return "Listener is not able to listen to itself";
            }
            if (!_.isFunction(listenable.listen)) {
                return listenable + " is missing a listen method";
            }
            if (listenable.hasListener && listenable.hasListener(this)) {
                return "Listener cannot listen to this listenable because of circular loop";
            }
        },

        /**
         * Sets up a subscription to the given listenable for the context object
         *
         * @param {Action|Store} listenable An Action or Store that should be
         *  listened to.
         * @param {Function|String} callback The callback to register as event handler
         * @param {Function|String} defaultCallback The callback to register as default handler
         * @returns {Object} A subscription obj where `stop` is an unsub function and `listenable` is the object being listened to
         */
        listenTo: function(listenable, callback, defaultCallback) {
            var desub, unsubscriber, subscriptionobj, subs = this.subscriptions = this.subscriptions || [];
            _.throwIf(this.validateListening(listenable));
            this.fetchInitialState(listenable, defaultCallback);
            desub = listenable.listen(this[callback]||callback, this);
            unsubscriber = function() {
                var index = subs.indexOf(subscriptionobj);
                _.throwIf(index === -1,'Tried to remove listen already gone from subscriptions list!');
                subs.splice(index, 1);
                desub();
            };
            subscriptionobj = {
                stop: unsubscriber,
                listenable: listenable
            };
            subs.push(subscriptionobj);
            return subscriptionobj;
        },

        /**
         * Stops listening to a single listenable
         *
         * @param {Action|Store} listenable The action or store we no longer want to listen to
         * @returns {Boolean} True if a subscription was found and removed, otherwise false.
         */
        stopListeningTo: function(listenable){
            var sub, i = 0, subs = this.subscriptions || [];
            for(;i < subs.length; i++){
                sub = subs[i];
                if (sub.listenable === listenable){
                    sub.stop();
                    _.throwIf(subs.indexOf(sub)!==-1,'Failed to remove listen from subscriptions list!');
                    return true;
                }
            }
            return false;
        },

        /**
         * Stops all subscriptions and empties subscriptions array
         */
        stopListeningToAll: function(){
            var remaining, subs = this.subscriptions || [];
            while((remaining=subs.length)){
                subs[0].stop();
                _.throwIf(subs.length!==remaining-1,'Failed to remove listen from subscriptions list!');
            }
        },

        /**
         * Used in `listenTo`. Fetches initial data from a publisher if it has a `getInitialState` method.
         * @param {Action|Store} listenable The publisher we want to get initial state from
         * @param {Function|String} defaultCallback The method to receive the data
         */
        fetchInitialState: function (listenable, defaultCallback) {
            defaultCallback = (defaultCallback && this[defaultCallback]) || defaultCallback;
            var me = this;
            if (_.isFunction(defaultCallback) && _.isFunction(listenable.getInitialState)) {
                var data = listenable.getInitialState();
                if (data && _.isFunction(data.then)) {
                    data.then(function() {
                        defaultCallback.apply(me, arguments);
                    });
                } else {
                    defaultCallback.call(this, data);
                }
            }
        },

        /**
         * The callback will be called once all listenables have triggered at least once.
         * It will be invoked with the last emission from each listenable.
         * @param {...Publishers} publishers Publishers that should be tracked.
         * @param {Function|String} callback The method to call when all publishers have emitted
         * @returns {Object} A subscription obj where `stop` is an unsub function and `listenable` is an array of listenables
         */
        joinTrailing: maker("last"),

        /**
         * The callback will be called once all listenables have triggered at least once.
         * It will be invoked with the first emission from each listenable.
         * @param {...Publishers} publishers Publishers that should be tracked.
         * @param {Function|String} callback The method to call when all publishers have emitted
         * @returns {Object} A subscription obj where `stop` is an unsub function and `listenable` is an array of listenables
         */
        joinLeading: maker("first"),

        /**
         * The callback will be called once all listenables have triggered at least once.
         * It will be invoked with all emission from each listenable.
         * @param {...Publishers} publishers Publishers that should be tracked.
         * @param {Function|String} callback The method to call when all publishers have emitted
         * @returns {Object} A subscription obj where `stop` is an unsub function and `listenable` is an array of listenables
         */
        joinConcat: maker("all"),

        /**
         * The callback will be called once all listenables have triggered.
         * If a callback triggers twice before that happens, an error is thrown.
         * @param {...Publishers} publishers Publishers that should be tracked.
         * @param {Function|String} callback The method to call when all publishers have emitted
         * @returns {Object} A subscription obj where `stop` is an unsub function and `listenable` is an array of listenables
         */
        joinStrict: maker("strict")
    };

},{"./joins":15,"./utils":19}],6:[function(_dereq_,module,exports){
    var _ = _dereq_('./utils'),
        ListenerMethods = _dereq_('./ListenerMethods');

    /**
     * A module meant to be consumed as a mixin by a React component. Supplies the methods from
     * `ListenerMethods` mixin and takes care of teardown of subscriptions.
     * Note that if you're using the `connect` mixin you don't need this mixin, as connect will
     * import everything this mixin contains!
     */
    module.exports = _.extend({

        /**
         * Cleans up all listener previously registered.
         */
        componentWillUnmount: ListenerMethods.stopListeningToAll

    }, ListenerMethods);

},{"./ListenerMethods":5,"./utils":19}],7:[function(_dereq_,module,exports){
    var _ = _dereq_('./utils');

    /**
     * A module of methods for object that you want to be able to listen to.
     * This module is consumed by `createStore` and `createAction`
     */
    module.exports = {

        /**
         * Hook used by the publisher that is invoked before emitting
         * and before `shouldEmit`. The arguments are the ones that the action
         * is invoked with. If this function returns something other than
         * undefined, that will be passed on as arguments for shouldEmit and
         * emission.
         */
        preEmit: function() {},

        /**
         * Hook used by the publisher after `preEmit` to determine if the
         * event should be emitted with given arguments. This may be overridden
         * in your application, default implementation always returns true.
         *
         * @returns {Boolean} true if event should be emitted
         */
        shouldEmit: function() { return true; },

        /**
         * Subscribes the given callback for action triggered
         *
         * @param {Function} callback The callback to register as event handler
         * @param {Mixed} [optional] bindContext The context to bind the callback with
         * @returns {Function} Callback that unsubscribes the registered event handler
         */
        listen: function(callback, bindContext) {
            bindContext = bindContext || this;
            var eventHandler = function(args) {
                if (aborted){
                    return;
                }
                callback.apply(bindContext, args);
            }, me = this, aborted = false;
            this.emitter.addListener(this.eventLabel, eventHandler);
            return function() {
                aborted = true;
                me.emitter.removeListener(me.eventLabel, eventHandler);
            };
        },

        /**
         * Attach handlers to promise that trigger the completed and failed
         * child publishers, if available.
         *
         * @param {Object} The promise to attach to
         */
        promise: function(promise) {
            var me = this;

            var canHandlePromise =
                this.children.indexOf('completed') >= 0 &&
                this.children.indexOf('failed') >= 0;

            if (!canHandlePromise){
                throw new Error('Publisher must have "completed" and "failed" child publishers');
            }

            promise.then(function(response) {
                return me.completed(response);
            }, function(error) {
                return me.failed(error);
            });
        },

        /**
         * Subscribes the given callback for action triggered, which should
         * return a promise that in turn is passed to `this.promise`
         *
         * @param {Function} callback The callback to register as event handler
         */
        listenAndPromise: function(callback, bindContext) {
            var me = this;
            bindContext = bindContext || this;
            this.willCallPromise = (this.willCallPromise || 0) + 1;

            var removeListen = this.listen(function() {

                if (!callback) {
                    throw new Error('Expected a function returning a promise but got ' + callback);
                }

                var args = arguments,
                    promise = callback.apply(bindContext, args);
                return me.promise.call(me, promise);
            }, bindContext);

            return function () {
                me.willCallPromise--;
                removeListen.call(me);
            };

        },

        /**
         * Publishes an event using `this.emitter` (if `shouldEmit` agrees)
         */
        trigger: function() {
            var args = arguments,
                pre = this.preEmit.apply(this, args);
            args = pre === undefined ? args : _.isArguments(pre) ? pre : [].concat(pre);
            if (this.shouldEmit.apply(this, args)) {
                this.emitter.emit(this.eventLabel, args);
            }
        },

        /**
         * Tries to publish the event on the next tick
         */
        triggerAsync: function(){
            var args = arguments,me = this;
            _.nextTick(function() {
                me.trigger.apply(me, args);
            });
        },

        /**
         * Returns a Promise for the triggered action
         *
         * @return {Promise}
         *   Resolved by completed child action.
         *   Rejected by failed child action.
         *   If listenAndPromise'd, then promise associated to this trigger.
         *   Otherwise, the promise is for next child action completion.
         */
        triggerPromise: function(){
            var me = this;
            var args = arguments;

            var canHandlePromise =
                this.children.indexOf('completed') >= 0 &&
                this.children.indexOf('failed') >= 0;

            var promise = _.createPromise(function(resolve, reject) {
                // If `listenAndPromise` is listening
                // patch `promise` w/ context-loaded resolve/reject
                if (me.willCallPromise) {
                    _.nextTick(function() {
                        var old_promise_method = me.promise;
                        me.promise = function (promise) {
                            promise.then(resolve, reject);
                            // Back to your regularly schedule programming.
                            me.promise = old_promise_method;
                            return me.promise.apply(me, arguments);
                        };
                        me.trigger.apply(me, args);
                    });
                    return;
                }

                if (canHandlePromise) {
                    var removeSuccess = me.completed.listen(function(args) {
                        removeSuccess();
                        removeFailed();
                        resolve(args);
                    });

                    var removeFailed = me.failed.listen(function(args) {
                        removeSuccess();
                        removeFailed();
                        reject(args);
                    });
                }

                me.triggerAsync.apply(me, args);

                if (!canHandlePromise) {
                    resolve();
                }
            });

            return promise;
        }
    };

},{"./utils":19}],8:[function(_dereq_,module,exports){
    /**
     * A module of methods that you want to include in all stores.
     * This module is consumed by `createStore`.
     */
    module.exports = {
    };

},{}],9:[function(_dereq_,module,exports){
    module.exports = function(store, definition) {
        for (var name in definition) {
            if (Object.getOwnPropertyDescriptor && Object.defineProperty) {
                var propertyDescriptor = Object.getOwnPropertyDescriptor(definition, name);

                if (!propertyDescriptor.value || typeof propertyDescriptor.value !== 'function' || !definition.hasOwnProperty(name)) {
                    continue;
                }

                store[name] = definition[name].bind(store);
            } else {
                var property = definition[name];

                if (typeof property !== 'function' || !definition.hasOwnProperty(name)) {
                    continue;
                }

                store[name] = property.bind(store);
            }
        }

        return store;
    };

},{}],10:[function(_dereq_,module,exports){
    var Reflux = _dereq_('./index'),
        _ = _dereq_('./utils');

    module.exports = function(listenable,key){
        return {
            getInitialState: function(){
                if (!_.isFunction(listenable.getInitialState)) {
                    return {};
                } else if (key === undefined) {
                    return listenable.getInitialState();
                } else {
                    return _.object([key],[listenable.getInitialState()]);
                }
            },
            componentDidMount: function(){
                _.extend(this,Reflux.ListenerMethods);
                var me = this, cb = (key === undefined ? this.setState : function(v){me.setState(_.object([key],[v]));});
                this.listenTo(listenable,cb);
            },
            componentWillUnmount: Reflux.ListenerMixin.componentWillUnmount
        };
    };

},{"./index":14,"./utils":19}],11:[function(_dereq_,module,exports){
    var Reflux = _dereq_('./index'),
        _ = _dereq_('./utils');

    module.exports = function(listenable, key, filterFunc) {
        filterFunc = _.isFunction(key) ? key : filterFunc;
        return {
            getInitialState: function() {
                if (!_.isFunction(listenable.getInitialState)) {
                    return {};
                } else if (_.isFunction(key)) {
                    return filterFunc.call(this, listenable.getInitialState());
                } else {
                    // Filter initial payload from store.
                    var result = filterFunc.call(this, listenable.getInitialState());
                    if (result) {
                        return _.object([key], [result]);
                    } else {
                        return {};
                    }
                }
            },
            componentDidMount: function() {
                _.extend(this, Reflux.ListenerMethods);
                var me = this;
                var cb = function(value) {
                    if (_.isFunction(key)) {
                        me.setState(filterFunc.call(me, value));
                    } else {
                        var result = filterFunc.call(me, value);
                        me.setState(_.object([key], [result]));
                    }
                };

                this.listenTo(listenable, cb);
            },
            componentWillUnmount: Reflux.ListenerMixin.componentWillUnmount
        };
    };


},{"./index":14,"./utils":19}],12:[function(_dereq_,module,exports){
    var _ = _dereq_('./utils'),
        Reflux = _dereq_('./index'),
        Keep = _dereq_('./Keep'),
        allowed = {preEmit:1,shouldEmit:1};

    /**
     * Creates an action functor object. It is mixed in with functions
     * from the `PublisherMethods` mixin. `preEmit` and `shouldEmit` may
     * be overridden in the definition object.
     *
     * @param {Object} definition The action object definition
     */
    var createAction = function(definition) {

        definition = definition || {};
        if (!_.isObject(definition)){
            definition = {actionName: definition};
        }

        for(var a in Reflux.ActionMethods){
            if (!allowed[a] && Reflux.PublisherMethods[a]) {
                throw new Error("Cannot override API method " + a +
                    " in Reflux.ActionMethods. Use another method name or override it on Reflux.PublisherMethods instead."
                );
            }
        }

        for(var d in definition){
            if (!allowed[d] && Reflux.PublisherMethods[d]) {
                throw new Error("Cannot override API method " + d +
                    " in action creation. Use another method name or override it on Reflux.PublisherMethods instead."
                );
            }
        }

        definition.children = definition.children || [];
        if (definition.asyncResult){
            definition.children = definition.children.concat(["completed","failed"]);
        }

        var i = 0, childActions = {};
        for (; i < definition.children.length; i++) {
            var name = definition.children[i];
            childActions[name] = createAction(name);
        }

        var context = _.extend({
            eventLabel: "action",
            emitter: new _.EventEmitter(),
            _isAction: true
        }, Reflux.PublisherMethods, Reflux.ActionMethods, definition);

        var functor = function() {
            return functor[functor.sync?"trigger":"triggerPromise"].apply(functor, arguments);
        };

        _.extend(functor,childActions,context);

        Keep.createdActions.push(functor);

        return functor;

    };

    module.exports = createAction;

},{"./Keep":4,"./index":14,"./utils":19}],13:[function(_dereq_,module,exports){
    var _ = _dereq_('./utils'),
        Reflux = _dereq_('./index'),
        Keep = _dereq_('./Keep'),
        mixer = _dereq_('./mixer'),
        allowed = {preEmit:1,shouldEmit:1},
        bindMethods = _dereq_('./bindMethods');

    /**
     * Creates an event emitting Data Store. It is mixed in with functions
     * from the `ListenerMethods` and `PublisherMethods` mixins. `preEmit`
     * and `shouldEmit` may be overridden in the definition object.
     *
     * @param {Object} definition The data store object definition
     * @returns {Store} A data store instance
     */
    module.exports = function(definition) {

        definition = definition || {};

        for(var a in Reflux.StoreMethods){
            if (!allowed[a] && (Reflux.PublisherMethods[a] || Reflux.ListenerMethods[a])){
                throw new Error("Cannot override API method " + a +
                    " in Reflux.StoreMethods. Use another method name or override it on Reflux.PublisherMethods / Reflux.ListenerMethods instead."
                );
            }
        }

        for(var d in definition){
            if (!allowed[d] && (Reflux.PublisherMethods[d] || Reflux.ListenerMethods[d])){
                throw new Error("Cannot override API method " + d +
                    " in store creation. Use another method name or override it on Reflux.PublisherMethods / Reflux.ListenerMethods instead."
                );
            }
        }

        definition = mixer(definition);

        function Store() {
            var i=0, arr;
            this.subscriptions = [];
            this.emitter = new _.EventEmitter();
            this.eventLabel = "change";
            bindMethods(this, definition);
            if (this.init && _.isFunction(this.init)) {
                this.init();
            }
            if (this.listenables){
                arr = [].concat(this.listenables);
                for(;i < arr.length;i++){
                    this.listenToMany(arr[i]);
                }
            }
        }

        _.extend(Store.prototype, Reflux.ListenerMethods, Reflux.PublisherMethods, Reflux.StoreMethods, definition);

        var store = new Store();
        Keep.createdStores.push(store);

        return store;
    };

},{"./Keep":4,"./bindMethods":9,"./index":14,"./mixer":18,"./utils":19}],14:[function(_dereq_,module,exports){
    exports.ActionMethods = _dereq_('./ActionMethods');

    exports.ListenerMethods = _dereq_('./ListenerMethods');

    exports.PublisherMethods = _dereq_('./PublisherMethods');

    exports.StoreMethods = _dereq_('./StoreMethods');

    exports.createAction = _dereq_('./createAction');

    exports.createStore = _dereq_('./createStore');

    exports.connect = _dereq_('./connect');

    exports.connectFilter = _dereq_('./connectFilter');

    exports.ListenerMixin = _dereq_('./ListenerMixin');

    exports.listenTo = _dereq_('./listenTo');

    exports.listenToMany = _dereq_('./listenToMany');


    var maker = _dereq_('./joins').staticJoinCreator;

    exports.joinTrailing = exports.all = maker("last"); // Reflux.all alias for backward compatibility

    exports.joinLeading = maker("first");

    exports.joinStrict = maker("strict");

    exports.joinConcat = maker("all");

    var _ = _dereq_('./utils');

    exports.EventEmitter = _.EventEmitter;

    exports.Promise = _.Promise;

    /**
     * Convenience function for creating a set of actions
     *
     * @param definitions the definitions for the actions to be created
     * @returns an object with actions of corresponding action names
     */
    exports.createActions = function(definitions) {
        var actions = {};
        for (var k in definitions){
            if (definitions.hasOwnProperty(k)) {
                var val = definitions[k],
                    actionName = _.isObject(val) ? k : val;

                actions[actionName] = exports.createAction(val);
            }
        }
        return actions;
    };

    /**
     * Sets the eventmitter that Reflux uses
     */
    exports.setEventEmitter = function(ctx) {
        var _ = _dereq_('./utils');
        exports.EventEmitter = _.EventEmitter = ctx;
    };


    /**
     * Sets the Promise library that Reflux uses
     */
    exports.setPromise = function(ctx) {
        var _ = _dereq_('./utils');
        exports.Promise = _.Promise = ctx;
    };


    /**
     * Sets the Promise factory that creates new promises
     * @param {Function} factory has the signature `function(resolver) { return [new Promise]; }`
     */
    exports.setPromiseFactory = function(factory) {
        var _ = _dereq_('./utils');
        _.createPromise = factory;
    };


    /**
     * Sets the method used for deferring actions and stores
     */
    exports.nextTick = function(nextTick) {
        var _ = _dereq_('./utils');
        _.nextTick = nextTick;
    };

    /**
     * Provides the set of created actions and stores for introspection
     */
    exports.__keep = _dereq_('./Keep');

    /**
     * Warn if Function.prototype.bind not available
     */
    if (!Function.prototype.bind) {
        console.error(
            'Function.prototype.bind not available. ' +
            'ES5 shim required. ' +
            'https://github.com/spoike/refluxjs#es5'
        );
    }

},{"./ActionMethods":3,"./Keep":4,"./ListenerMethods":5,"./ListenerMixin":6,"./PublisherMethods":7,"./StoreMethods":8,"./connect":10,"./connectFilter":11,"./createAction":12,"./createStore":13,"./joins":15,"./listenTo":16,"./listenToMany":17,"./utils":19}],15:[function(_dereq_,module,exports){
    /**
     * Internal module used to create static and instance join methods
     */

    var slice = Array.prototype.slice,
        _ = _dereq_("./utils"),
        createStore = _dereq_("./createStore"),
        strategyMethodNames = {
            strict: "joinStrict",
            first: "joinLeading",
            last: "joinTrailing",
            all: "joinConcat"
        };

    /**
     * Used in `index.js` to create the static join methods
     * @param {String} strategy Which strategy to use when tracking listenable trigger arguments
     * @returns {Function} A static function which returns a store with a join listen on the given listenables using the given strategy
     */
    exports.staticJoinCreator = function(strategy){
        return function(/* listenables... */) {
            var listenables = slice.call(arguments);
            return createStore({
                init: function(){
                    this[strategyMethodNames[strategy]].apply(this,listenables.concat("triggerAsync"));
                }
            });
        };
    };

    /**
     * Used in `ListenerMethods.js` to create the instance join methods
     * @param {String} strategy Which strategy to use when tracking listenable trigger arguments
     * @returns {Function} An instance method which sets up a join listen on the given listenables using the given strategy
     */
    exports.instanceJoinCreator = function(strategy){
        return function(/* listenables..., callback*/){
            _.throwIf(arguments.length < 3,'Cannot create a join with less than 2 listenables!');
            var listenables = slice.call(arguments),
                callback = listenables.pop(),
                numberOfListenables = listenables.length,
                join = {
                    numberOfListenables: numberOfListenables,
                    callback: this[callback]||callback,
                    listener: this,
                    strategy: strategy
                }, i, cancels = [], subobj;
            for (i = 0; i < numberOfListenables; i++) {
                _.throwIf(this.validateListening(listenables[i]));
            }
            for (i = 0; i < numberOfListenables; i++) {
                cancels.push(listenables[i].listen(newListener(i,join),this));
            }
            reset(join);
            subobj = {listenable: listenables};
            subobj.stop = makeStopper(subobj,cancels,this);
            this.subscriptions = (this.subscriptions || []).concat(subobj);
            return subobj;
        };
    };

// ---- internal join functions ----

    function makeStopper(subobj,cancels,context){
        return function() {
            var i, subs = context.subscriptions,
                index = (subs ? subs.indexOf(subobj) : -1);
            _.throwIf(index === -1,'Tried to remove join already gone from subscriptions list!');
            for(i=0;i < cancels.length; i++){
                cancels[i]();
            }
            subs.splice(index, 1);
        };
    }

    function reset(join) {
        join.listenablesEmitted = new Array(join.numberOfListenables);
        join.args = new Array(join.numberOfListenables);
    }

    function newListener(i,join) {
        return function() {
            var callargs = slice.call(arguments);
            if (join.listenablesEmitted[i]){
                switch(join.strategy){
                    case "strict": throw new Error("Strict join failed because listener triggered twice.");
                    case "last": join.args[i] = callargs; break;
                    case "all": join.args[i].push(callargs);
                }
            } else {
                join.listenablesEmitted[i] = true;
                join.args[i] = (join.strategy==="all"?[callargs]:callargs);
            }
            emitIfAllListenablesEmitted(join);
        };
    }

    function emitIfAllListenablesEmitted(join) {
        for (var i = 0; i < join.numberOfListenables; i++) {
            if (!join.listenablesEmitted[i]) {
                return;
            }
        }
        join.callback.apply(join.listener,join.args);
        reset(join);
    }

},{"./createStore":13,"./utils":19}],16:[function(_dereq_,module,exports){
    var Reflux = _dereq_('./index');


    /**
     * A mixin factory for a React component. Meant as a more convenient way of using the `ListenerMixin`,
     * without having to manually set listeners in the `componentDidMount` method.
     *
     * @param {Action|Store} listenable An Action or Store that should be
     *  listened to.
     * @param {Function|String} callback The callback to register as event handler
     * @param {Function|String} defaultCallback The callback to register as default handler
     * @returns {Object} An object to be used as a mixin, which sets up the listener for the given listenable.
     */
    module.exports = function(listenable,callback,initial){
        return {
            /**
             * Set up the mixin before the initial rendering occurs. Import methods from `ListenerMethods`
             * and then make the call to `listenTo` with the arguments provided to the factory function
             */
            componentDidMount: function() {
                for(var m in Reflux.ListenerMethods){
                    if (this[m] !== Reflux.ListenerMethods[m]){
                        if (this[m]){
                            throw "Can't have other property '"+m+"' when using Reflux.listenTo!";
                        }
                        this[m] = Reflux.ListenerMethods[m];
                    }
                }
                this.listenTo(listenable,callback,initial);
            },
            /**
             * Cleans up all listener previously registered.
             */
            componentWillUnmount: Reflux.ListenerMethods.stopListeningToAll
        };
    };

},{"./index":14}],17:[function(_dereq_,module,exports){
    var Reflux = _dereq_('./index');

    /**
     * A mixin factory for a React component. Meant as a more convenient way of using the `listenerMixin`,
     * without having to manually set listeners in the `componentDidMount` method. This version is used
     * to automatically set up a `listenToMany` call.
     *
     * @param {Object} listenables An object of listenables
     * @returns {Object} An object to be used as a mixin, which sets up the listeners for the given listenables.
     */
    module.exports = function(listenables){
        return {
            /**
             * Set up the mixin before the initial rendering occurs. Import methods from `ListenerMethods`
             * and then make the call to `listenTo` with the arguments provided to the factory function
             */
            componentDidMount: function() {
                for(var m in Reflux.ListenerMethods){
                    if (this[m] !== Reflux.ListenerMethods[m]){
                        if (this[m]){
                            throw "Can't have other property '"+m+"' when using Reflux.listenToMany!";
                        }
                        this[m] = Reflux.ListenerMethods[m];
                    }
                }
                this.listenToMany(listenables);
            },
            /**
             * Cleans up all listener previously registered.
             */
            componentWillUnmount: Reflux.ListenerMethods.stopListeningToAll
        };
    };

},{"./index":14}],18:[function(_dereq_,module,exports){
    var _ = _dereq_('./utils');

    module.exports = function mix(def) {
        var composed = {
            init: [],
            preEmit: [],
            shouldEmit: []
        };

        var updated = (function mixDef(mixin) {
            var mixed = {};
            if (mixin.mixins) {
                mixin.mixins.forEach(function (subMixin) {
                    _.extend(mixed, mixDef(subMixin));
                });
            }
            _.extend(mixed, mixin);
            Object.keys(composed).forEach(function (composable) {
                if (mixin.hasOwnProperty(composable)) {
                    composed[composable].push(mixin[composable]);
                }
            });
            return mixed;
        }(def));

        if (composed.init.length > 1) {
            updated.init = function () {
                var args = arguments;
                composed.init.forEach(function (init) {
                    init.apply(this, args);
                }, this);
            };
        }
        if (composed.preEmit.length > 1) {
            updated.preEmit = function () {
                return composed.preEmit.reduce(function (args, preEmit) {
                    var newValue = preEmit.apply(this, args);
                    return newValue === undefined ? args : [newValue];
                }.bind(this), arguments);
            };
        }
        if (composed.shouldEmit.length > 1) {
            updated.shouldEmit = function () {
                var args = arguments;
                return !composed.shouldEmit.some(function (shouldEmit) {
                    return !shouldEmit.apply(this, args);
                }, this);
            };
        }
        Object.keys(composed).forEach(function (composable) {
            if (composed[composable].length === 1) {
                updated[composable] = composed[composable][0];
            }
        });

        return updated;
    };

},{"./utils":19}],19:[function(_dereq_,module,exports){
    /*
     * isObject, extend, isFunction, isArguments are taken from undescore/lodash in
     * order to remove the dependency
     */
    var isObject = exports.isObject = function(obj) {
        var type = typeof obj;
        return type === 'function' || type === 'object' && !!obj;
    };

    exports.extend = function(obj) {
        if (!isObject(obj)) {
            return obj;
        }
        var source, prop;
        for (var i = 1, length = arguments.length; i < length; i++) {
            source = arguments[i];
            for (prop in source) {
                if (Object.getOwnPropertyDescriptor && Object.defineProperty) {
                    var propertyDescriptor = Object.getOwnPropertyDescriptor(source, prop);
                    Object.defineProperty(obj, prop, propertyDescriptor);
                } else {
                    obj[prop] = source[prop];
                }
            }
        }
        return obj;
    };

    exports.isFunction = function(value) {
        return typeof value === 'function';
    };

    exports.EventEmitter = _dereq_('eventemitter3');

    exports.nextTick = function(callback) {
        setTimeout(callback, 0);
    };

    exports.capitalize = function(string){
        return string.charAt(0).toUpperCase()+string.slice(1);
    };

    exports.callbackName = function(string){
        return "on"+exports.capitalize(string);
    };

    exports.object = function(keys,vals){
        var o={}, i=0;
        for(;i<keys.length;i++){
            o[keys[i]] = vals[i];
        }
        return o;
    };

    exports.Promise = _dereq_("native-promise-only");

    exports.createPromise = function(resolver) {
        return new exports.Promise(resolver);
    };

    exports.isArguments = function(value) {
        return typeof value === 'object' && ('callee' in value) && typeof value.length === 'number';
    };

    exports.throwIf = function(val,msg){
        if (val){
            throw Error(msg||val);
        }
    };

},{"eventemitter3":1,"native-promise-only":2}]},{},[14])
(14)
});
